include LoadRoute
Blog::Application.routes.draw do
  # add_page_routes_defined_in_database

  get "ajax/edit_post"
  match "edit_post" => "ajax#edit_post", :as => "edit_post"

  get "ajax/add_comment"
  match "add_comment" => "ajax#add_comment", :as => "add_comment"

  get "ajax/del_comment"
  match "del_comment" => "ajax#del_comment", :as => "del_comment"

  get "ajax/load_post"
  match "load_post" => "ajax#load_post", :as => "load_post"
  match "load_post/:id" => "ajax#load_post", :as => "load_another_post"

  get "post/new"
  match "new_post" => "post#new", :as => "new_post"

  get "post/detail"

  get "post/edit"

  get "post/delete"
  match "delete_post/:id" => "post#delete", :as => "delete_post"

  get "user/login"
  match "login" => "user#login", :as => "login"

  get "user/logout"
  match "logout" => "user#logout", :as => "logout"

  get "user/profile"
  match "user/profile" => "user#profile", :as => "profile"
  match "user/profile/:id" => "user#profile", :as => "user_profile"

  get "user/delete_user"
  match "delete_user/:id" => "user#delete_user", :as => "delete_user"

  get "user/signup"
  match "signup" => "user#signup", :as => "signup"

  get "user/index"
  match "user" => "user#index", :as => "user"
  match "user/:id" => "user#index", :as => "another_user"

  get "home/index"

  root :to => "home#index"

  get "admin/home/index"
  match "admin/index" => "admin/home#index", :as => "admin_home"

  get "/openid" => "openid#index", :as => :openid
  post "/openid/start" => "openid#start", :as => :openid_start
  #match "/openid" => "openid#index", :as => :openid
  match "/openid/complete" => "openid#complete", :as => :openid_complete
  match "/oauth/callback" => "oauth#callback", :as => :oauth_callback
  match "/oauth/index" => "oauth#index", :as => :oauth_index
  # The priority is based upon order of creation:
  # first created -> highest priority.

  # Sample of regular route:
  #   match 'products/:id' => 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Sample resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Sample resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Sample resource route with more complex sub-resources
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', :on => :collection
  #     end
  #   end

  # Sample resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end

  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  # root :to => "welcome#index"

  # See how all your routes lay out with "rake routes"

  # This is a legacy wild controller route that's not recommended for RESTful applications.
  # Note: This route will make all actions in every controller accessible via GET requests.
  # match ':controller(/:action(/:id(.:format)))'
end
